package mulMan.gui.view;

import java.awt.event.ActionListener;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JMenuItem;

import mulMan.domain.Playlist;

public class PlaylistMenuView extends JMenuItem implements Observer  {
	
	private static final long serialVersionUID = -1832562607607718597L;
	
	private Playlist playlist;
	
	public PlaylistMenuView(Playlist playlist) {
		super();
		
		this.playlist = playlist;
		playlist.addObserver(this);
		
		setText(this.playlist.getName());
	}

	public void update(Observable arg0, Object arg1) {
		setText(this.playlist.getName());
		updateUI();
	}
	
	public void addAddAudioFileToPlaylistListener(ActionListener aaftpl) {
		this.addActionListener(aaftpl);
	}

}
